package com.zhw.goshopping.controller;

import com.zhw.goshopping.common.pojo.EasyUITreeNode;
import com.zhw.goshopping.common.pojo.GoShoppingResult;
import com.zhw.goshopping.content.service.ContentService;
import com.zhw.goshopping.pojo.TbContent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * Create by zhaihongwei on 2018/4/10
 */
@Controller
public class ContentController {

    @Autowired
    private ContentService contentService;

    /**
     * 查询网站内容信息列表
     * @param categoryId
     * @return
     */
    @RequestMapping("/content/query/list")
    @ResponseBody
    public List<EasyUITreeNode> getContentList(@RequestParam(value ="categoryId")long categoryId) {
        return null;
    }

    /**
     * 添加内容信息
     * @param tbContent
     * @return
     */
    @RequestMapping("/content/save")
    @ResponseBody
    public GoShoppingResult addContent(TbContent tbContent) {
        GoShoppingResult result = contentService.addContent(tbContent);
        return result;
    }
}
